{% for type in ["Int8", "Int16", "Int32", "Int64", 'UInt8', 'UInt16', 'UInt32'] -%}

DROP TABLE IF EXISTS bftest__fuzz_21;

CREATE TABLE bftest__fuzz_21
(
    `k` Int64,
    `x` Array({{ type }}),
    INDEX ix1 x TYPE bloom_filter GRANULARITY 3
)
ENGINE = MergeTree
ORDER BY k;

INSERT INTO bftest__fuzz_21 (k, x) SELECT
    number,
    arrayMap(i -> (rand64() % 565656), range(10))
FROM numbers(1000);

{% if 'UInt' in type -%}
    SELECT count() FROM bftest__fuzz_21 WHERE hasAll(x, [42, -42]) SETTINGS use_skip_indexes=1;
    SELECT count() FROM bftest__fuzz_21 WHERE hasAll(x, [42, -42]) SETTINGS use_skip_indexes=1, force_data_skipping_indices='ix1'; -- { serverError INDEX_NOT_USED }
{% else -%}
    SELECT count() FROM bftest__fuzz_21 WHERE hasAll(x, [42, -42]) SETTINGS use_skip_indexes=1, force_data_skipping_indices='ix1';
{% endif -%}

DROP TABLE IF EXISTS bftest__fuzz_21;

{% endfor -%}
